﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Functions/Messege/messege.master" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="HRDexCapstoneProject.Functions.Messege.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainPage" runat="server">
    <div align="center">
    <asp:GridView ID="GridView1" runat="server" Width="389px" 
    style="text-align: center" onselectedindexchanged="GridView1_SelectedIndexChanged" 
            AutoGenerateColumns="False" DataSourceID="formMessege" 
            DataKeyNames="MessegeSenderID">
        <Columns>
            <asp:BoundField DataField="MessegeSenderID" HeaderText="MessegeSenderID" 
                SortExpression="MessegeSenderID" InsertVisible="False" ReadOnly="True" />
            <asp:BoundField DataField="Subject" HeaderText="Subject" 
                SortExpression="Subject" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="DateTime" HeaderText="DateTime" 
                SortExpression="DateTime" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="catMessegeName" HeaderText="catMessegeName" 
                SortExpression="catMessegeName" />
            
         <%--   <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                SortExpression="EmployeeID" />--%>
        <%--    <asp:BoundField DataField="catMessegeID" HeaderText="catMessegeID" 
                SortExpression="catMessegeID" />--%>
            
           <%-- <asp:BoundField DataField="MessegeReceiverID" HeaderText="MessegeReceiverID" 
                InsertVisible="False" ReadOnly="True" SortExpression="MessegeReceiverID" />--%>

                 <asp:TemplateField HeaderText="View Details"> 
<ItemTemplate> 
    <asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Functions/Messege/Add.aspx?MessegeSenderID={0}", Eval("MessegeSenderID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
        </Columns>
</asp:GridView>
        <asp:SqlDataSource ID="formMessege" runat="server" 
            ConnectionString="<%$ ConnectionStrings:HRdexDBConnectionString %>" 
            
            
            
            SelectCommand="SELECT formMessegeSender.Subject, formMessegeSender.Description, formMessegeSender.Attachments, formMessegeSender.DateTime, formEmployees.LastName, formEmployees.FirstName, catMessege.catMessegeName, formMessegeSender.MessegeSenderID FROM formMessegeSender INNER JOIN formEmployees ON formMessegeSender.EmployeeID = formEmployees.EmployeesID INNER JOIN catMessege ON formMessegeSender.catMessegeID = catMessege.catMessegeID">
        </asp:SqlDataSource>
</div>
</asp:Content>
